import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { SRobIslandMiniPlayer } from "../../../../../Message/Game/SRobIslandMiniPlayer";
import { Language } from "../../../../../extend/language/Language";
import { ObjCreate } from "../../common/ObjCreate";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
//class PetIslandApplyInfoItemRenderer
    
    export  class PetIslandApplyInfoItemRenderer extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        /* internal  */onPetNameClick(arg1: Object /* flash.events.TextEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.PetIslandGetPetInfo, this._vo.entityId));
            return;
        }

        /* internal  */onPlaynameCick(arg1: Object /* flash.events.TextEvent */): void
        {
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            if (typeof arg1 === "srobislandminiplayer") 
            {
                this._vo = arg1 as SRobIslandMiniPlayer;
                this._playname.text = this._vo.name;
                this._petName.htmlText = Language.getStringByParam(28109, this._vo.petName);
            }
            return;
        }

        protected /* override */ createChildren(): void
        {
            this._petName = ObjCreate.createGTextField("", 0, 7, 110, 20, this, GlobalStyle.setTextFormatAlign(GlobalStyle._textFormat5, flash.text.TextFormatAlign.CENTER));
            this._playname = ObjCreate.createGTextField("", 110, 7, 110, 20, this, GlobalStyle.setTextFormatAlign(GlobalStyle._textFormat5, flash.text.TextFormatAlign.CENTER));
            ObjCreate.createBg(0, 30, 220, 2, this, ImagesConst.SplitLine);
            this._petName.addEventListener(flash.events.TextEvent.LINK, this.onPetNameClick);
            return;
        }

        /* internal */ /* var */_petName: GTextFiled;

        /* internal */ /* var */_playname: GTextFiled;

        /* internal */ /* var */_vo: SRobIslandMiniPlayer;
    }
